package ru.spb.osll.myfit.fixtures.base;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class MyFitGracefulNamerTest {
	@Test
	public void testUnGracefulName() throws Exception {
		assertEquals("bad_company", MyFitGracefulNamer.disgrace("Bad Company"));
		assertEquals("bad_company", MyFitGracefulNamer.disgrace("bad company"));
		assertEquals("bad_company", MyFitGracefulNamer.disgrace("Bad-Company"));
		assertEquals("bad_company", MyFitGracefulNamer.disgrace("Bad Company."));
		assertEquals("_bad_company", MyFitGracefulNamer.disgrace("(Bad Company)"));
		assertEquals("badcompany", MyFitGracefulNamer.disgrace("BadCompany"));
		assertEquals("bad_123_company", MyFitGracefulNamer
				.disgrace("bad 123 company"));
		assertEquals("bad_123_company", MyFitGracefulNamer
				.disgrace("bad 123company"));
		assertEquals("_bad_123_company", MyFitGracefulNamer
				.disgrace("   bad  \t123  company   "));
		assertEquals("bad_123_company", MyFitGracefulNamer
				.disgrace("Bad123Company"));
		assertEquals("my_namespace_bad_123_company", MyFitGracefulNamer
				.disgrace("My.Namespace.Bad123Company"));
	}

	@Test
	public void testEmptyString() throws Exception {
		assertEquals("", MyFitGracefulNamer.disgrace(""));
	}

}
